<template>
  <div id="app">
    <!-- <scale-box :width="1920" :height="1080" bgc="transparent" :delay="100"> -->
    <router-view v-if="isRouterAlive" />
    <!-- </scale-box> -->
  </div>
</template>

<script>
import ScaleBox from "vue2-scale-box";
export default {
  name: "App",
  components: {
    ScaleBox,
  },
  provide() {
    //父组件中通过provide来提供变量，在子组件中通过inject来注入变量。
    return {
      reload: this.reload,
    };
  },
  data() {
    return {
      isRouterAlive: true, //控制视图是否显示的变量
    };
  },
  created() {},
  methods: {
    reload() {
      this.isRouterAlive = false; //先关闭，
      this.$nextTick(() => {
        this.isRouterAlive = true; //再打开
      });
    },
  },
};
</script>
<style lang="scss">
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.flex-btw {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.flex-middle {
  display: flex;
  align-items: center;
}
.flex-column {
  display: flex;
  flex-direction: column;
}
.flex-aro {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.flex-column-start {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
</style>
